package com.huaxin.hxcloud.activity;

import android.content.Context;
import android.content.Intent;

import com.huaxin.hxcloud.R;
import com.huaxin.hxcloud.work.HxLDPlanManagerActivity;
import com.huaxin.hxcloud.work.HxLDRepositoryActivity;
import com.huaxin.hxcloud.work.HxSPTMaintenanceActivity;
import com.huaxin.hxcloud.work.HxScSyncDataActivty;

/**
 * Created by Administrator on 2016/9/7.
 */
public class ModuleItem {

    public static ModuleItem ATTENDANCE = new ModuleItem(0, R.string.module_attendance, R.drawable.module_icon_attendence,
            SignActivity.class);
    public static ModuleItem WORKTASK   = new ModuleItem(1, R.string.module_worktask, R.drawable.module_icon_worktask,
            ArrangeTaskListActivity.class);
    public static ModuleItem STATION    = new ModuleItem(2, R.string.module_station, R.drawable.module_icon_station,
            StationListActivity.class);
    public static ModuleItem SC_STATION = new ModuleItem(2, R.string.module_station, R.drawable.module_icon_station,
            HxScStationTreeListActivity.class);
    public static ModuleItem VEHICLE    = new ModuleItem(3, R.string.module_vehicle, R.drawable.module_icon_vehicle,
            VehicleMgtActivity.class);
    public static ModuleItem REPORT     = new ModuleItem(4, R.string.module_report, R.drawable.module_icon_report,
            ReportActivity.class);
    public static ModuleItem WARNING    = new ModuleItem(5, R.string.module_test, R.drawable.module_icon_help,
            WarningListActivity.class);
    public static ModuleItem PUNCHCARD  = new ModuleItem(6, R.string.module_punchcard, R.drawable.module_icon_punch,
            HxPunchCardActivity.class);
    public static ModuleItem COLLECT    = new ModuleItem(6, R.string.module_collect, R.drawable.module_icon_collect,
            HxCollectActivity.class);
    public static ModuleItem WORKFLOW   = new ModuleItem(6, R.string.module_work_flow, R.drawable.module_icon_workflow,
            HxTaskWaitDoActivity.class);
    public static ModuleItem SC_SYNCDATA   = new ModuleItem(6, R.string.module_synthesize_data, R.drawable.module_icon_synthesize,
            HxScSyncDataActivty.class);
    public static ModuleItem LD_PLANMANAGER   = new ModuleItem(6, R.string.module_plan_manageer, R.drawable.module_icon_plan_manager,
            HxLDPlanManagerActivity.class);
    public static ModuleItem LD_REPOSITORY   = new ModuleItem(7, R.string.module_repository, R.drawable.module_icon_repository,
            HxLDRepositoryActivity.class);
    public static ModuleItem SPT_MAINTENANCE    = new ModuleItem(7, R.string.module_maintenance, R.drawable.module_icon_maintenance,
            HxSPTMaintenanceActivity.class);
    private int      idx;
    private int      resName;
    private int      resIcon;
    private Class<?> clz;

    private ModuleItem(int idx, int resName, int resIcon, Class<?> clz) {
        this.idx = idx;
        this.resName = resName;
        this.resIcon = resIcon;
        this.clz = clz;
    }

    public void startActivity(Context context) {
        if (getClz() != null) {
            Intent intent = new Intent();
            intent.setClass(context, getClz());
            context.startActivity(intent);
        }
    }

    public int getIdx() {
        return idx;
    }

    public void setIdx(int idx) {
        this.idx = idx;
    }

    public int getResName() {
        return resName;
    }

    public void setResName(int resName) {
        this.resName = resName;
    }

    public int getResIcon() {
        return resIcon;
    }

    public void setResIcon(int resIcon) {
        this.resIcon = resIcon;
    }

    public Class<?> getClz() {
        return clz;
    }

    public void setClz(Class<?> clz) {
        this.clz = clz;
    }
}
